package econosim;

public abstract class UtilityAgent extends TransActionAgent {
	
	private double utility = 0;
	private double savings = 0;

	public synchronized void setSavings(double value) {
		savings = value;
	}
	
	public synchronized void setUtility(double value) {
		utility = value;
	}
	
	public synchronized double getSavings() {
		return savings;
	}
	
	public synchronized double getUtility() {
		return utility;
	}
	
	public  synchronized void addUtility(double utility) {
		this.utility += utility;
	}

	public synchronized void reduceUtility(double utility) {
		this.utility -= utility;
	}
	
	public synchronized void payMoney(double price) {
		savings -= price;
	}

	public synchronized  void receiveMoney(double price) {
		savings += price;
	}
}

